<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../../vue.js"></script>
</head>

<body>
  <div id="app">
    <!-- 只生效一次 -->
    <div v-once>
      {{message}}
    </div>
    <!-- 原始的html -->
    <div v-html="str"></div>

    <button v-bind:id="btnid">更新</button>

    <a v-bind:[attrname]="link">连接</a>

    <button v-bind:disabled="isButtonDisabled">Button</button>


    <div>
      {{ 1+1 }}
      <hr>
      {{ true ? "1":"2" }}
      <hr>
      {{new Date()}}
      <!-- 不可以执行 -->
      <!-- {{var str ="hello";}} -->

    </div>

  </div>

  <script>


    var vm = new Vue({
      el: "#app",
      data: {
        message: "hello world",
        str: "<h1>gp18</h1>",
        btnid: "btn-update",
        link: "http://www.baidu.com",
        attrname: "href",
        isButtonDisabled: null
      },
      created() {
        setTimeout(() => {
          this.message = "gp18"
          this.btnid = "gp18-btn"
        }, 3000)
      }
    })

  </script>

</body>

</html>